<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>新建二维码</title>
	
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			background: #fff;
		}
		.public_buttonSearch_container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 15px 0;
			background: #e9e9e9;
		}
		.public_buttonSearch_container a{
			color: #fff;
			background-color: #1E9FFF;
			text-shadow: 0 -1px 0 rgba(0,0,0,.12);
			height: 24px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
		}
		.public_buttonSearch_container button{
			border: none;
			color: #fff;
			background-color: #1E9FFF;
			text-shadow: 0 -1px 0 rgba(0,0,0,.12);
			height: 35px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
		}
		.public_Search_container{
			position: relative;
		}
		.public_Search_container input{
			width: 240px;
			height: 32px;
			border: 1px solid #d9d9d9;
		}
		.public_Search_container i{
			position: absolute;
			bottom: 6px;
			right: 10px;
			cursor: pointer;
		}
		.public_title_active{
			color: #1E9FFF;
			border-bottom: 1px solid #1E9FFF;
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
		}
		.public_title_container a{
			margin-right: 30px;
			height: 54px;
			line-height: 54px;
			cursor: pointer;
		}
		/*SwitchTab start*/
		.CustomQr_SwitchTab_container{
			padding: 15px 16px;
			background: #fff;
			border-radius: 4px 4px 0px 0px;
		}
		.CustomQr_SwitchTab_content{
			display: flex;
			align-items: center;
		}
		.CustomQr_SwitchTab_active{
			background: #1890ff !important;
			color: #fff !important;
			border: 1px solid #1890ff !important;
		}
		.CustomQr_SwitchTab_content a{
			width: 140px;
			height: 32px;
			display: flex;
			align-items: center;
			justify-content: center;
			border: 1px solid #D9DDE2;
			cursor: pointer;
			color: rgba(0,0,0,.65);
		}
		.CustomQr_SwitchTab_content a:first-child{
			border-radius: 2px 0px 0px 2px;
			border-right: none;
		}
		.CustomQr_SwitchTab_content a:last-child{
			border-radius: 0px 2px 2px 0px;
		}
		/*SwitchTab end*/
	</style>
</head>
<body>
	<!-- 顶部提示框 结束 -->
	<div class="public_container">
		<div class="public_content">
			<div class="public_title_container">
				<a href="index.html" class="public_title_active">点餐码列表</a>
				<a href="add_bg.html">配置</a>
			</div>
			<div class="public_buttonSearch_container">
				<div class="public_buttonSearch_content">
					<a href="add_customqrs.html">+ 新建点餐码</a>
				</div>
			</div>
		</div>
		<div class="CustomQr_SwitchTab_container">
			<div class="CustomQr_SwitchTab_content">
				<a href="index.html">小程序点餐</a>
				<a href="list.html"  class="CustomQr_SwitchTab_active">公众号点餐</a>
			</div>
		</div>
		<div class="qrcode_table_container" style="display: block;">
			<!-- 公共表格部分 -->
			<div class="public_table_container layui-form" style="padding: 0 0 15px 0;">
				<table class="layui-table" lay-skin="line" style="margin: 0;">
				    <thead>
				      <tr style="background: #e9e9e9;">
				        <th>二维码</th>
				        <th>标题</th>
				        <th>使用人员</th>
				        <th>创建时间</th>
				        <th>操作</th>
				      </tr> 
				    </thead>
				    <tbody>
				      {loop $res as $r}
					  <tr>
						<td><img src="{$create_qrcode}?id={$r->id}" width="50px;"></td>
						<td>{$r->title}</td>
						<td>{$r->user->name}</td>
						<td><?php echo date("Y-m-d H:i:s",$r->ctime)?></td>
						<td>
						<a class="table-public-btn" href="add_customqrs-{$r->id}.html">编辑</a>
						<a class="table-public-btn" target="_blank" href="download_qrcode-{$r->id}.html">下载</a>
						<a class="table-public-btn" onclick="del_customqr({$r->id})">删除</a>
						</td>
					  </tr>
					{/loop}
				    </tbody>
				</table>
			</div> 
			<!-- 公共表格部分 end-->
			
          	<div class="main-container-h pageing-container-h">
	          	<div class="pageing-content-h">
	               	<span>{$p->totalnum}条/{$p->totalpage}页</span>
	          	</div>
	          	<ul class="pageing-content-h">{P weidogsadmin}</ul>
          	</div>
		</div>
		
	</div>
	
<script src="/cdn/jquery.js"></script>
<script src="/layui/layui.js"></script>
<script src="/js/ajax.js"></script>
<script type="text/javascript">
	function del_customqr(id){
		myAjaxPost(false, true, 'del_customqr.html', { id:id}, function (resp) {
			if(resp.status == "success"){
			 	layer.msg(resp.msg);
              	setTimeout(function(){
                	window.location.reload();
              	},1000);
			}else{
				layer.msg(resp.msg);
			} 	
		})
	}
	layui.use('layer', function(){
	  	var layer = layui.layer;
	}); 
	function add_bg(){
		layer.open({
			type: 2,
			title: '请选择使用人员',
			shadeClose: true,
			shade: 0.2,
			area: ['700px', '530px'],
			content: 'add_bg.html'
		}); 
	}
</script>
</body>
</html>